<?php

defined( '_JEXEC' ) or die( 'Restricted access' );

class TOOLBAR_orders {
	function _ADDSTORE(){
		//JToolBarHelper::title( JText::_( 'Taobao Orders' ), 'generic.png' );
	}
	function _EDITSTORE(){
		
	}
	function _MNGSTORE() {
		JToolBarHelper::title( JText::_( 'Taobao Store' ), 'generic.png' );
    	$toolbar=&JToolBar::getInstance('toolbar');  
    	JToolBarHelper::addNew('addstore');
    	JToolBarHelper::editList('editstore');
    	JToolBarHelper::deleteListX(JText::_( 'Taobao Store Delete Comfirm' ));
    	$toolbar->prependButton('Link', 'archive', 'Taobao Orders Import', JURI::base().'index.php?option=com_orders&view=items&task=import');
    	
      	JSubMenuHelper::addEntry(JText::_('Taobao Orders Undo'), 'index.php?option=com_orders&view=items&task=lists&status=undo');
		JSubMenuHelper::addEntry(JText::_('Taobao Orders Done'), 'index.php?option=com_orders&view=items&task=lists&status=done');
		JSubMenuHelper::addEntry(JText::_('Taobao Orders All'), 'index.php?option=com_orders&view=items&task=lists&status=all'); 
		JSubMenuHelper::addEntry(JText::_('Taobao Orders Mng Store'), 'index.php?option=com_orders&controller=store&view=items&task=mngstore', true); 
	}
	
	function _DEFAULT() {
		JToolBarHelper::title( JText::_( 'Taobao Orders' ), 'generic.png' );
    	$toolbar=&JToolBar::getInstance('toolbar');    	
    	//$toolbar->prependButton('Link', 'archive', 'Taobao Orders Add Store', JURI::base().'index.php?option=com_orders&controller=store&view=items&task=addstore');
    	$toolbar->prependButton('Link', 'archive', 'Taobao Orders Import', JURI::base().'index.php?option=com_orders&view=items&task=import');
      	JSubMenuHelper::addEntry(JText::_('Taobao Orders Undo'), 'index.php?option=com_orders&view=items&task=lists&status=undo');
		JSubMenuHelper::addEntry(JText::_('Taobao Orders Done'), 'index.php?option=com_orders&view=items&task=lists&status=done');
		JSubMenuHelper::addEntry(JText::_('Taobao Orders All'), 'index.php?option=com_orders&view=items&task=lists&status=all'); 
		//JSubMenuHelper::addEntry(JText::_('Taobao Orders Mng Store'), 'index.php?option=com_orders&controller=store&view=items&task=mngstore'); 
	}
	function _LISTS() {
		$status = JRequest::getVar('status');
		$undo=$done=$all=false;
		switch ($status){
			case 'undo':
				$undo = true;
				break;
			case 'done':
				$done = true;
				break;
			case 'all':
				$all = true;
				break;
		}
		JToolBarHelper::title( JText::_( 'Taobao Orders' ), 'generic.png' );
    	$toolbar=&JToolBar::getInstance('toolbar');    	
    	//$toolbar->prependButton('Link', 'archive', 'Taobao Orders Add Store', JURI::base().'index.php?option=com_orders&controller=store&view=items&task=addstore');
    	$toolbar->prependButton('Link', 'archive', 'Taobao Orders Import', JURI::base().'index.php?option=com_orders&view=items&task=import');
      	JSubMenuHelper::addEntry(JText::_('Taobao Orders Undo'), 'index.php?option=com_orders&view=items&task=lists&status=undo',$undo);
		JSubMenuHelper::addEntry(JText::_('Taobao Orders Done'), 'index.php?option=com_orders&view=items&task=lists&status=done',$done);
		JSubMenuHelper::addEntry(JText::_('Taobao Orders All'), 'index.php?option=com_orders&view=items&task=lists&status=all',$all); 
		//JSubMenuHelper::addEntry(JText::_('Taobao Orders Mng Store'), 'index.php?option=com_orders&controller=store&view=items&task=mngstore'); 
	}

}

?>